﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Urgencias
{
    public partial class Ingresar : Form
    {
        extras ex = new extras();
        public Ingresar()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            String nombre, apellido, rut, direccion, isapre, doctor, PDA, telefono, edad,box,DC;
            nombre = textBox1.Text;
            apellido = textBox2.Text;
            edad = textBox3.Text;
            rut = textBox4.Text;
            telefono = textBox5.Text;
            box = textBox6.Text;
            doctor = textBox7.Text;
            DC = textBox8.Text;
            PDA = textBox9.Text;
            isapre = textBox10.Text;
            direccion = textBox11.Text;

            if (nombre != "" || apellido != "" || rut != "" || edad != "" || direccion != "" || isapre != "" || doctor != "" || PDA != "" || telefono != "" || DC != "" || box != "")
            {
                ex.agregarPaciente(nombre, apellido, rut, edad, direccion, isapre, doctor, PDA, telefono, box, DC);
                MessageBox.Show("Paciente ingresado exitosamente.");
            }
            else
            {
                MessageBox.Show("Ingrese todos los datos.");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {

        }

        public void restablecer()
        {
            textBox1.ResetText();
            textBox2.ResetText();
            textBox3.ResetText();
            textBox4.ResetText();
            textBox5.ResetText();
            textBox6.ResetText();
            textBox7.ResetText();
            textBox8.ResetText();
            textBox9.ResetText();
            textBox10.ResetText();
            textBox11.ResetText();
        }
    }
}
